<style>
.weui_uploader_file {
  float: left;
  margin-right: 9px;
  margin-bottom: 0;
  margin-top: 9px;
  width: 5rem;
  height: 5rem;
  background: no-repeat center center;
  background-size: cover;
}

</style>
<div class="weui_cells weui_cells_form" style="border-radius:0.5rem;">            
				<div class="weui_cells_title" style="padding-left:0">
				<span class="bold" style="color:#18bc9c">{{pagedata.nowkey+1}}</span>
				<span style="color:#18bc9c">[{{pagedata.nowitem.typetitle}}]</span>
				{{pagedata.nowitem.title}}
				</div>
				<div ng-if="pagedata.nowitem.images.length>0" class="remark img">
					<span ng-repeat="img in pagedata.nowitem.images" class="img" style="padding:0.1rem">
						<img style="height:3rem;max-height:100%;" ng-click="pagedata.show_bigimage=true;pagedata.showimage=img" ng-src="{{tomedia(img)}}" />
					</span>
				</div>
				<div ng-if="pagedata.nowitem.type == 4" class="weui_cells weui_cells_radio2" style="margin-top:0.3rem">
						<label class="weui_cell weui_check_label dashed" ng-repeat="(key,value) in pagedata.nowitem.xuanxiang">
							<div class="weui_cell_ft" href="javascript:;" ng-click="pagedata.nowitem.data=key;pagedata.checkdanan(key);">
								<input type="radio" class="weui_check" ng-checked="pagedata.nowitem.data==key">
								<span class="weui_icon_checked"></span>
							</div>
							<div class="weui_cell_bd weui_cell_primary">
								<span style="float:left;width:100%">{{pagedata.danan_key[key]}}.{{value.title}}</span>
								<span ng-if="value.img" ng-click="pagedata.show_bigimage=true;pagedata.showimage=value.img"><img style="height:2rem" ng-src="{{tomedia(value.img)}}"/></span>
							</div>
							
						</label>
				</div>	
				<div ng-if="pagedata.nowitem.type == 5" class="weui_cells weui_cells_checkbox" style="padding:0.5rem;margin-top:0.3rem">
						<label class="weui_cell weui_check_label" ng-repeat="(key,value) in pagedata.nowitem.xuanxiang">
							<div class="weui_cell_hd">
								<input type="checkbox" ng-click="duoxuans(key,pagedata.nowitem,'data');pagedata.checkdanan(key);" class="weui_check" ng-checked="pagedata.nowitem.data.indexOf(';'+key+';')>=0">
								<i class="weui_icon_checked"></i>
							</div>
							<div class="weui_cell_bd weui_cell_primary">
								<span>{{pagedata.danan_key[key]}}. {{value.title}}</span>
								<span ng-if="value.img" ng-click="pagedata.show_bigimage=true;pagedata.showimage=value.img"><img style="height:2rem" ng-src="{{tomedia(value.img)}}"/></span>
							</div>
						</label>
				</div>
				<div ng-if="pagedata.nowitem.type == 20" class="weui_cells weui_cells_radio2" style="margin-top:0.3rem">
						<label class="weui_cell weui_check_label dashed">
							<div class="weui_cell_ft" href="javascript:;"  ng-click="pagedata.nowitem.data=0;pagedata.checkdanan(0);">
								<input type="radio" class="weui_check" ng-checked="pagedata.nowitem.data==0">
								<span class="weui_icon_checked"></span>
							</div>
							<div class="weui_cell_bd weui_cell_primary">
								<span style="float:left;width:100%">{{pagedata.danan_key[0]}}.对</span>
							</div>
						</label>
						<label class="weui_cell weui_check_label dashed">
							<div class="weui_cell_ft" href="javascript:;"  ng-click="pagedata.nowitem.data=1;pagedata.checkdanan(1);">
								<input type="radio" class="weui_check" ng-checked="pagedata.nowitem.data==1">
								<span class="weui_icon_checked"></span>
							</div>
							<div class="weui_cell_bd weui_cell_primary">
								<span style="float:left;width:100%">{{pagedata.danan_key[1]}}.错</span>
							</div>
							
						</label>
				</div>
				<div ng-if="pagedata.nowitem.iscuo == 1" class="weui_cell" style="background:#f2f2f2;padding:0.5rem;margin-bottom:0.5rem">
						<div class="weui_cell_hd red">
							答题错误：正确答案是	
						</div>
						<div class="weui_cell_bd weui_cell_primary">
							{{pagedata.nowitem.daan}}
						</div>
				</div>
				<div ng-if="pagedata.nowitem.iscuo == 1" class="weui_cell" style="background:#f2f2f2;padding:0.5rem;margin-bottom:0.5rem">
						<div class="weui_cell_bd weui_cell_primary" style="padding:0">
						<div class="red">
							解析：
						</div>
						<div ng-bind-html="trust(pagedata.nowitem.desc)"></div>
						</div>
				</div>
</div>
<!--图片放大-->
<div ng-if="pagedata.show_bigimage"  class="popup">
	<div class="popup-body">
	<div class="popup-center">
		<div ng-click="pagedata.show_bigimage=false" class="image" style="border-radius: 2rem; height:18rem;background: url({{tomedia(pagedata.showimage)}}) no-repeat 50% 0;background-size:100%;background-position:center center">
		</div>
	</div>
	</div>
</div>
<script type="text/javascript">
scope.pagedata.extradata=scope.pagedata.extradata?scope.pagedata.extradata:{}
scope.pagedata.onitem=function(){
	if(scope.pagedata.params.page==1){
		scope.message('已经是第一题了！');
		return false
	}
	scope.pagedata.params.page--
	scope.pagedata.getnowitem();
	scope.$evalAsync();
}
scope.pagedata.nextitem=function(){
	if(scope.pagedata.params.page==scope.pagedata.allnum){
		scope.message('已经是最后一题了！');
		return false
	}
	scope.pagedata.up_xuetimes();
	scope.pagedata.params.page++
	scope.pagedata.getnowitem();
}
scope.pagedata.checkdanan=function(key){
	console.log(key);
	//console.log(scope.pagedata.nowitem);
	//console.log(scope.pagedata.danan_key);
	if(scope.pagedata.nowitem.type==5){
		var data=scope.pagedata.nowitem.data.split(";");
		//console.log(data);
		scope.pagedata.nowitem.iscuo=0;
		for(var i=0;i<data.length;i++){
		   if(data[i]){
				var danan_key=scope.pagedata.danan_key[data[i]];
				//console.log(danan_key);
				//console.log(scope.pagedata.nowitem.daan.indexOf(danan_key));
				if(scope.pagedata.nowitem.daan.indexOf(danan_key)==-1){
					scope.pagedata.nowitem.iscuo=1;
					scope.pagedata.upcuo(scope.pagedata.nowitem);
				}
			}
		}
	}else{
		if(scope.pagedata.nowitem.daan!=scope.pagedata.danan_key[key]){
			scope.pagedata.nowitem.iscuo=1;
			scope.pagedata.upcuo(scope.pagedata.nowitem);
		}else{
			scope.pagedata.nowitem.iscuo=0;
		}
	}
}
scope.pagedata.upcuo=function(nowitem){
	scope.post_json('jy_kaoshi/cuo_ti/update/',scope.pagedata.nowitem,function(res){
	});
}
scope.pagedata.up_xuetimes=function(){
	scope.post_json('jy_kaoshi/lianxi/upxuetimes/',scope.pagedata.nowitem,function(res){
	});
}
</script>
